const http = require('http');

// 请求选项
const options = {
  hostname: 'localhost',
  port: 10003,  // API网关端口
  path: '/user-service/users/info',
  method: 'GET',
  headers: {
    'Authorization': 'Bearer your-jwt-token-here'  // 替换为有效的JWT token
  }
};

// 发送请求
const req = http.request(options, (res) => {
  console.log(`状态码: ${res.statusCode}`);
  
  res.on('data', (chunk) => {
    console.log(`响应内容: ${chunk}`);
  });
});

req.on('error', (error) => {
  console.error('请求错误:', error);
});

req.end();